//
//  UIBarButtonExtension.swift
//  WhyTest
//
//  Created by 宋广越 on 2022/2/11.
//

import Foundation
import UIKit

extension UIBarButtonItem{
//    class func createItem(imageName:String,highImageName:String,size:CGSize)->UIBarButtonItem{
//        let btn = UIButton()
//        let point = CGPoint(x:0,y:0)
//
//        btn.setImage(UIImage(named: imageName), for: .normal)
//        btn.setImage(UIImage(named: highImageName), for: .highlighted)
//        btn.frame = CGRect(origin: point, size: size)
//        return UIBarButtonItem(customView: btn)
//    }
 convenience init(imageName:String,highImageName:String,size:CGSize) {
             let btn = UIButton()
             let point = CGPoint(x:0,y:0)
             btn.setImage(UIImage(named: imageName), for: .normal)
             btn.setImage(UIImage(named: highImageName), for: .highlighted)
             btn.frame = CGRect(origin: point, size: size)
            self.init(customView : btn)
    }
convenience init(imageName:String) {
                let btn = UIButton()
                btn.setImage(UIImage(named: imageName), for: .normal)
                self.init(customView : btn)
       }
}
